#
# @Author: CopyRight@ xyg[2369941198@qq.com] 
# @Date: 2021-04-01 15:49:25 
# @Last Modified by:   xyg[2369941198@qq.com] 
# @Last Modified time: 2021-04-01 15:49:25 
#

from Carmer import Carmer
import cv2
import Servo

#
PIN_Servo_01 = 8
PIN_Servo_02 = 10
GPIO.setmode(GPIO.BOARD)
GPIO.setwarnings(False)

# 舵机初始化

carmer_obj = Carmer(Carmer.video_local)
# capture = cv.VideoCapture(video_online)

while True:
    frame, pos = carmer_obj.face_detect()
    cv2.imshow("view", frame)
    c = cv2.waitKey(1) & 0xff  # 等待30ms显示图像，若过程中按“Esc”退出?
    if c == 27:
        carmer_obj.release()
carmer_obj.release()
cv.waitKey()
cv.destroyAllWindows()